<template>
  <div id="app">
    <Header></Header>
    <!-- 路由组件出口 -->
    <router-view></router-view>
    <!-- 在Home\Search显示,在login\register隐藏 -->
    <Footer v-show="$route.meta.show"></Footer>
  </div>
</template>

<script>
//引入
import Header from "./components/Header/Header.vue";
import Footer from "./components/Footer/Footer.vue";

export default {
  name: "App",
  components: {
    Header,
    Footer,
  },
  mounted() {
    //通知vuex发请求,获取数据,存储在仓库中
    this.$store.dispatch("categoryList");
    //获取用户信息在首页展示
    this.$store.dispatch("getUserInfo");
  },
};
</script>

<style></style>
